set(AICoder_SRC
    AICoder.cpp
    AICoder.h
)

if(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
    add_library(AICoder MODULE ${AICoder_SRC})
    
    target_link_libraries(AICoder
        codeblocks
        ${wxWidgets_LIBRARIES}
    )
    
    set_target_properties(AICoder PROPERTIES
        PREFIX ""
        OUTPUT_NAME "AICoder"
    )
    
    install(TARGETS AICoder
        DESTINATION ${CB_PLUGINS_INSTALL_DIR}
    )
endif()

# 添加协作框架源文件
set(COLLABORATION_SOURCES
    CollaborativeCore/CollaborationProtocol.cpp
    ModelModuleSystem/ModelComponent.cpp  
    GlobalRegistry/ComponentRegistry.cpp
)

# 添加到现有目标
target_sources(AICoder PRIVATE ${COLLABORATION_SOURCES})

# 添加包含目录
target_include_directories(AICoder PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/CollaborativeCore
    ${CMAKE_CURRENT_SOURCE_DIR}/ModelModuleSystem
    ${CMAKE_CURRENT_SOURCE_DIR}/GlobalRegistry
)

# 添加新的协作框架源文件
set(COLLABORATION_SOURCES
    CollaborativeCore/CollaborationProtocol.cpp
    CollaborativeCore/RealTimeEditor.cpp
    ModelModuleSystem/ModelComponent.cpp
    ModelModuleSystem/ComponentAssembler.cpp
    GlobalRegistry/ComponentRegistry.cpp
)

# 添加到现有目标
target_sources(AICoder PRIVATE ${COLLABORATION_SOURCES})

# 添加包含目录
target_include_directories(AICoder PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/CollaborativeCore
    ${CMAKE_CURRENT_SOURCE_DIR}/ModelModuleSystem
    ${CMAKE_CURRENT_SOURCE_DIR}/GlobalRegistry
)

# 添加必要的链接库
target_link_libraries(AICoder PRIVATE
    wx_base
    wx_core
)
